package com.app.ctzoverseas.page.main.home

import com.android.base_network.extend.asResponse
import com.android.basemvvm.BaseViewModel
import com.app.ctzoverseas.network.model.GetDataBean
import com.blankj.utilcode.util.LogUtils
import com.cardetective.shopcar.utils.InjectUtil
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.catch

class HomeViewModel: BaseViewModel() {

//    private val homeRepo by lazy { InjectUtil.get() }
//
//    private val _bannerList = MutableSharedFlow<List<GetDataBean.BannerInData>>()
//    val bannerList: SharedFlow<List<GetDataBean.BannerInData>> = _bannerList
//
//    fun getBannerList(type: Int = 1) {
//        launch {
//            homeRepo.getBannerList(type)
//                .asResponse()
//                .catch {
//                    LogUtils.e("getBannerList is error, msg: ${it.message}")
//                    mBVOnExceptionListener?.onListener(-1)
//
//                }.collect(_bannerList)
//        }
//    }




}